import http from '@/server/request.js';
import * as Utils from '@/utils/index.js';

let header = { 'content-type': 'application/json' };

/**
 * 获取栏目下文章
 */
export const getCmsArticle = async (param) => {
  const data = await http.request({
    baseUrl: 'https://api.wxls.pro',
    url: '/cms/pass/news',
    method: 'GET',
    data: param,
  });
  if (!data.data.success) {
    uni.showToast({
      title: data.data.message || '获取文章信息失败',
      duration: 2000,
      icon: 'none',
    });
    return Promise.reject(new Error(data.data.message || '获取文章信息失败'));
  }
  return data;
};
